import request from "@/utils/request";

/**
 * 产品-列表
 * @param {*} data
 */
export function getProList(param) {
  const { pageNum, pageSize, ...data } = param;
  return request({
    url: `/gongyuan/product/list?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data
  });
}

/**
 * 产品-根据ID查询
 * @param {*} id
 */
export function getProDetail(id) {
  return request({
    url: `gongyuan/product/${id}`,
    method: "get"
  });
}

/**
 * 产品-删除
 * @param {*} id
 */
export function delPro(id) {
  return request({
    url: `gongyuan/product/${id}`,
    method: "delete"
  });
}

/**
 * 产品-添加
 * @param {*} data
 */
export function addPro(data) {
  return request({
    url: "/gongyuan/product",
    method: "post",
    data
  });
}

/**
 * 产品-更新
 * @param {*} data
 */
export function updatePro(data) {
  return request({
    url: "/gongyuan/product",
    method: "put",
    data
  });
}
